<meta charset="utf-8" />
<div class="box" id="biz_authPermission_lookback_conatainer">
       <div class="box-header with-border" style="max-width: 1200px;" >
               <form id="searchbackForm" role="form" class="form-inline">
                    <div class="form-group">
                         <label>权限名称</label>
                         <input name="name" type="text" placeholder="" class="form-control">
                    </div>
                    <div class="form-group">
                    <label>权限代码</label>
                         <input name="permCode" id="permCode" type="text" placeholder="" class="form-control">
                    </div>
                     <div class="form-group" >
					 <label>所属应用</label>
						 <select id="appKey" v-model="appKey" name="appKey" v-kselect="{url:'auth/authApp/loadAuthAppComboboVo',firstEmpty:'true'}" class=" form-control"> </select>
					</div>
				
					 <div class="form-group" >
					 <label>所属模块</label>
						 <select id="moduleId"  v-model="moduleId"  name="moduleId" v-kselect="{url:'auth/authModule/loadModuleComboboVo',linkToDomId:'appKey',ajaxParamKey:'appKey',firstEmpty:'true'}" class=" form-control"> </select>
					</div> 
                     <button type="button"  class="btn btn-info pull-right m-t-n-xs" onclick="search();"><strong>查询</strong></button>
                </form>
            </div>
	<div class="box-body">
				<div class="btn-group " id="permissionToolbar" role="group">
				<button type="button" class="btn btn-default" v-on:click="confirm">
                        <i class="glyphicon glyphicon-ok" aria-hidden="true"></i>确认
                 </button>
                 <button type="button" class="btn btn-default" v-on:click="cancel">
                        <i class="glyphicon glyphicon-remove" aria-hidden="true"></i>取消
                 </button>                   
				</div>
				<table id="permissiontable" data-mobile-responsive="true"></table>
	</div>
</div>
	<script type="text/javascript">
	var newa=new Vue({  
		  el: '#biz_authPermission_lookback_conatainer', 
		  data:{
		    	bus:new Vue()
		  },
		  mounted:function(){
				 let _this=this;
				 _this.bus.$on(zfesVueDirective.getKselectOnInitEventName("appKey"), function (msg) {
					_this.initTable();
				 });
			  },
	    methods: {
	  	  initTable:function(){
	  		  let columns=[
	  				{checkbox:true},
					{field:'permCode',title:'权限编码',width:160,sortable:true},
					{field:'name',title:'权限名称',width:160},
					{field:'enabled',title:'是否启用',width:60,formatter:zfesUtil.formatEnabled},
					{field:'moduleName',title:'所属模块',width:80},
					{field:'appName',title:'所属应用',width:80},
					{field:'url',title:'权限地址',width:280},];
	  		  let url="auth/authPermission/loadAuthPermissionList";
	    		zfesBstable.laodTable($("#permissiontable"),$("#searchForm"),$("#permissionToolbar"),url,columns);
	  	  },
	  	  search:function(){
	  		  zfesBstable.reload($("#permissiontable")); 
	  	  },
	  	  confirm: function(){
	  		if (zfesBstable.isSelectedRow($("#permissiontable"))) {
				let rows = zfesBstable.getSelections($("#permissiontable"));
				zfesLayerEditDg.setCallBackParam(rows);
				zfesLayerEditDg.close();
			}
	  	  },
	  	cancel: function(){
	  		zfesLayerEditDg.close();
	  	 }
	   }
	});
</script>
